﻿using System;
using System.Collections.Generic;

using System.Text;
using System.ComponentModel;

namespace TA.Turbo.Controls
{
	/// <summary>
	/// Base class for all columns that output a data control.
	/// </summary>
	public abstract class BaseDataColumn : BasePresetColumn
	{
		/// <summary>
		/// Ctor.
		/// </summary>
		public BaseDataColumn()
		{
			this.Required = false;
			this.RequiredErrorMessage = "Required";
			this.ValidationGroup = "";
		}
		/// <summary>
		/// Contains properties that control the way the value controls output by this column are bound in data-binding scenarios.
		/// </summary>
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public FieldBinding Data { get { return _data; } }
		/// <summary>
		/// If true, a RequiredFieldValidator will be created.
		/// </summary>
		[DefaultValue(false)]
		public bool Required { get; set; }
		/// <summary>
		/// The message to be shown when validation fails.
		/// </summary>
		[DefaultValue("Required")]
		public string RequiredErrorMessage { get; set; }
		/// <summary>
		/// The group to which the validators output by this column belong.
		/// </summary>
		[DefaultValue("")]
		public string ValidationGroup { get; set; }

		FieldBinding _data = new FieldBinding();
	}
}
